<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Creating an SFTP User">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="en-us_topic_0000001965939061.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect Appliance 1.5.0-1.6.0 Help Center">
<meta name="DC.Publisher" content="20240608">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="EN-US_TOPIC_0000001966059265">
<meta name="DC.Language" content="en-us">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>Creating an SFTP User</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="EN-US_TOPIC_0000001966059265"></a><a name="EN-US_TOPIC_0000001966059265"></a>

<h1 class="topictitle1">Creating an SFTP User</h1>
<div><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_p159125100541">The system administrator can create an SFTP user with SFTP storage space. The system administrator can connect to the SFTP server as the SFTP user to upload and download user data.</p>
<div class="section" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232402_section52135297"><h4 class="sectiontitle">Prerequisites</h4><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p115222054124215">The SFTP service has been enabled.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_section186551153144815"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_ol61721291281"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_li31809451213"><span>Choose <span class="menucascade" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_menucascade1518044511114"><b><span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_uicontrol3181184514118"><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text0778132011103"><strong>System</strong></span></span></b> &gt; <b><span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_uicontrol1718164513119"><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text7957203510917"><strong>Settings</strong></span></span></b></span>.</span></li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_li1696145399"><span>In the navigation tree, click <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol153110351319"><b><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text1948213394103"><strong>SFTP Service</strong></span></b></span>.</span></li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li8802632469"><span>In the <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol1916413215418"><b><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text366619010111"><strong>Authorized Users</strong></span></b></span> area, click <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol748115312417"><b><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text17551118111113"><strong>Add</strong></span></b></span>.</span></li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_li6423103312715"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_li6423103312715"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_li6423103312715"></a><span>Set SFTP user parameters. <a href="#EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_table13374941017">Table 1</a> lists the parameters.</span><p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_table13374941017"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_table13374941017"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_table13374941017" frame="border" border="1" rules="all"><caption><b>Table 1 </b>SFTP user parameters</caption><colgroup><col style="width:23.96%"><col style="width:76.03999999999999%"></colgroup><thead align="left"><tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_row937139171015"><th align="left" class="cellrowborder" valign="top" width="23.96%" id="mcps1.3.3.2.4.2.1.2.3.1.1"><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_en-us_topic_0171822298_p43287665">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="76.03999999999999%" id="mcps1.3.3.2.4.2.1.2.3.1.2"><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_en-us_topic_0171822298_p16640014">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_row153810991014"><td class="cellrowborder" valign="top" width="23.96%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p6517565"><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text4386152991115"><strong>Username</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="76.03999999999999%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p58160785">Name of the new SFTP user</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p13403145">[Value range]</p>
<ul id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_ul53519446"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_li11912974">The value contains 6 to 32 characters.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1695319470583">The name can contain only digits, letters, and underscores (_), and must start with a letter or underscore (_).</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_li40107904">The name cannot contain sensitive characters (root, bin, daemon, adm, lp, sync, shutdown, halt, mail, operator, games, ftp, nobody, dbus, tss, polkitd, libstoragemgmt, unbound, setroubleshoot, chrony, ntp, sshd, rpc, cloudmonitor, rpcuser, nfsnobody, radvd, uvpkmc, dnsmasq, saslauth, qemu, gluster, dhcpd, and hwcdm). The sensitive characters are case insensitive.</li></ul>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p14107846">[Example]</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p59861751">sftpuser</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_row13381496108"><td class="cellrowborder" valign="top" width="23.96%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p18455085"><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text846114201115"><strong>Password</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="76.03999999999999%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p18466913">Password of the new SFTP user</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p19425014">[Value range]</p>
<ul id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_ul40607404"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_li29922324">The password contains 8 to 64 characters.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_li865461">The password must contain at least three types of the following: special characters (- ! @ % ^ * _ = + { } [ ] : , . \ / ? and spaces), uppercase letters, lowercase letters, and digits.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li974935915104">The password cannot be a palindrome, for example, hw123@321wh.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li01371247111513">The password cannot contain four or more consecutive identical characters.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li16385950191615">The password cannot contain three or more consecutive characters (q to m, a to z, and 1 to 9) or the characters in reverse order.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_li26941704">The password cannot contain three or more consecutive characters in the username or the username spelled backwards.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li9256111951418">The password cannot contain sensitive characters including root, bin, daemon, adm, lp, sync, shutdown, halt, mail, operator, games, ftp, nobody, dbus, tss, polkitd, libstoragemgmt, unbound, setroubleshoot, chrony, ntp, sshd, rpc, cloudmonitor, rpcuser, nfsnobody, radvd, uvpkmc, saslauth, qemu, gluster, dhcpd, or hwcdm.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li13956131271810">Characters are case insensitive in the preceding rules.</li></ul>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p65087093">[Example]</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p48912926">abfq@1248</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_row17381292106"><td class="cellrowborder" valign="top" width="23.96%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p22716784"><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text18714205116116"><strong>Confirm Password</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="76.03999999999999%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p28120176">Confirm password of the new SFTP user</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p63141756">[Value range]</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p31404899"><span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol1998712110125"><b><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text1164214316124"><strong>Confirm Password</strong></span></b></span> must be consistent with <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol148782301219"><b><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text1834449151217"><strong>Password</strong></span></b></span>.</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0223232411_p14208637">[Example]</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p148921364119">abfq@1248</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_row8393941011"><td class="cellrowborder" valign="top" width="23.96%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_p320516317119"><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text1271371110129"><strong>Quota</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="76.03999999999999%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_en-us_topic_0171822298_p4100073">Quota for the newly created SFTP user</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p11684161853319">The unit can be <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol174764362569"><b>GB</b></span> or <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol19508204175616"><b>TB</b></span>.</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p368912186328">The value must be greater than 0 GB and less than 800 TB. The value must be a valid integer.</p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_li117683399153"><span>Click <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol161741581645"><b><span id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_text182331428139"><strong>OK</strong></span></b></span>.</span></li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_section36681347143711"><h4 class="sectiontitle">Follow-up Procedure</h4><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p1158182383218"><strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b171584762510">Using the SFTP service</strong></p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p9316791620">After creating an SFTP user on the management interface, you can perform the following operations to use the SFTP service.</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p5884711091">If the local server runs the Windows OS, you are advised to download the SFTP tool for upload and download operations. If the local server runs the Linux OS, refer to the following steps:</p>
<ol id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ol4986539664"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li3354184518532"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li3354184518532"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_li3354184518532"></a>Run the following command to connect to the SFTP backup server as user <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b98411445361">sftpuser</strong>:<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen129721413151412">sftp -oPort=<em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i53471815158">Port number</em> <em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i19940113018148">username</em>@<em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i13940030151410">IP address</em></pre>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p139371550547">The following table describes the parameters.</p>

<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_table19645122441616" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters for connecting to the SFTP backup server</caption><colgroup><col style="width:27.189999999999998%"><col style="width:72.81%"></colgroup><thead align="left"><tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_row8646202412164"><th align="left" class="cellrowborder" valign="top" width="27.189999999999998%" id="mcps1.3.4.5.1.4.2.3.1.1"><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p136465247167">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="72.81%" id="mcps1.3.4.5.1.4.2.3.1.2"><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p14646624111610">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_row5646152413166"><td class="cellrowborder" valign="top" width="27.189999999999998%" headers="mcps1.3.4.5.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p18646152415168">Username</p>
</td>
<td class="cellrowborder" valign="top" width="72.81%" headers="mcps1.3.4.5.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p11646024131618">SFTP user added in <a href="#EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_li6423103312715">4</a>. <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1835616509467">sftpuser</strong> is used as an example.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_row206461247169"><td class="cellrowborder" valign="top" width="27.189999999999998%" headers="mcps1.3.4.5.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p136461724121612">IP Address</p>
</td>
<td class="cellrowborder" valign="top" width="72.81%" headers="mcps1.3.4.5.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p11646524141617">IP address of the SFTP server, that is, the IP address queried in <a href="en-us_topic_0000001938980050.html#EN-US_TOPIC_0000001938980050__en-us_topic_0000001955402757_en-us_topic_0000001839224857_li1225141815444">3</a> in <a href="en-us_topic_0000001938980050.html#EN-US_TOPIC_0000001938980050">Viewing the SFTP Service</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_row1864642415166"><td class="cellrowborder" valign="top" width="27.189999999999998%" headers="mcps1.3.4.5.1.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p18646124131612">Port Number</p>
</td>
<td class="cellrowborder" valign="top" width="72.81%" headers="mcps1.3.4.5.1.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p464611241164">Default value: <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b84687989854853">22</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_note613292113402"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_en-us_topic_0000001123352597_p10738881161">If exception <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b388712107501">WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!</strong> occurs when the SFTP user is used to connect to the SFTP backup server, , enter the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b547083125218">/root/.ssh/</strong> directory on the local server, delete the line containing the SFTP server IP address from the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b171996473524">known_hosts</strong> file, and try again.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li832614421873">Enter the password of user <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b9389135612508">sftpuser</strong> for logging in to the SFTP server as prompted. The SFTP CLI is displayed.<div class="note" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_note166010101164"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p14601210101611">After logging in to the SFTP server, you are advised to add one or more client user public keys to the SFTP server by referring to <a href="#EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_section2044233882315">Adding the Public Key of the SFTP Client User to the SFTP Server</a>. After the addition, you can use the public key to log in to the server as the corresponding user on the SFTP client in password-free mode.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li16417193210263">Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1686585111261">cd</strong> <em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i594116127281">Username</em> command to go to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b16653298017">/sftpuser</strong> directory on the SFTP backup server. Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b6184822102720">l</strong><strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b185977156279">cd</strong><strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b23508364280"> /opt</strong> command to go to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1203446004">/opt</strong> directory on the local server.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li3986153910618">Check the directories on the SFTP backup server and local server.<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p1831669663"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li3986153910618"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_li3986153910618"></a>Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1858653018515">pwd</strong> command to view the current directory of the SFTP backup server. Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b058617301510">lpwd</strong> command to view the current directory of the local server. For example, in the command output, the directory of the SFTP backup server is <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b20303849102415">/sftpuser</strong> and the directory of the local server is <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b12309104913241">/opt</strong>.</p>
<ul id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ul176441153121720"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li20538141261815">Use SFTP to upload a file to the SFTP backup server.<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p202762217910"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li20538141261815"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_li20538141261815"></a>Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b03161191569">put /opt/file1.conf /sftpuser</strong> command to upload the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b271211216523">file1.conf</strong> file in the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b771291285212">/opt</strong> directory on the local server to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1071314125520">/sftpuser</strong> directory on the SFTP backup server.</p>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li129701921131816">Use SFTP to upload a directory to the SFTP backup server.<ol type="a" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ol5565614144416"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li145651314104418">Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b638572214535">mkdir </strong><em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i123914229533">file1</em> command to create the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b183915228534">file1</strong> directory in the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b17392132295317">/sftpuser</strong> directory.<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p10561641864">The name of the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b203581370531">file1</strong> directory must be the same as the name of the directory to be uploaded on the local server.</p>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1581595354411">Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b16250125685319">put -r /opt/</strong><em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i10250956135312">file1</em><strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b825065625311"> /sftpuser</strong> command to upload the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b15251135665310">/opt/file1</strong> directory on the local server to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b42511556185310">/sftpuser</strong> directory on the SFTP backup server.</li></ol>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li176447532177">Use SFTP to download a file to the local server.<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p44601261085"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li176447532177"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_li176447532177"></a>Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1431616915612">get /sftpuser/file.conf /opt</strong> command to download the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b64133287549">file.conf</strong> file in the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b641311281543">/sftpuser</strong> directory on the SFTP backup server to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b17414628115415">/opt</strong> directory on the local server.</p>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li165559441812">Use SFTP to download a directory to the local server.<ol type="a" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ol1986715275012"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li169631813261">Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b166581746105616">mkdir </strong><em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i196581046165619">file</em> command to create the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b206581646195618">file</strong> directory in the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b665894619562">/opt</strong> directory.<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p1832318141361">The name of the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b148933559560">file</strong> directory must be the same as the name of the directory to be downloaded on the SFTP backup server.</p>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li19521112325019">Run the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b17570148115717">get -r /sftpuser/</strong><em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i457111816570">file</em><strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b457148195717"> /opt</strong> command to download the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b157115811577">/sftpuser/file</strong> directory on the SFTP backup server to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b05712805718">/opt</strong> directory on the local server.</li></ol>
</li></ul>
</li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_section2044233882315"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_section2044233882315"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_section2044233882315"></a><h4 class="sectiontitle">Adding the Public Key of the SFTP Client User to the SFTP Server</h4><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p174313612418">If multiple SFTP clients need to access the server as an SFTP user, you are advised to add the public keys of the SFTP client users to the server by referring to this section. The procedures for adding a public key for the first time and for a non-first time are different.</p>
<p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p18830561315">In the following example, under user <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b103221126141813">root</strong> on the client, user <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1486023811819">sftpuser</strong> is used to log in to the server.</p>
<ol id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ol199542309479"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li116231118654"><span>Run the following command to access the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b38114839711824">sftpuser</strong> user directory:</span><p><pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen1885964753815">cd /sftpuser</pre>
</p></li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li186061346102016"><span>Run the following command to check whether a public key has been added to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1201932212">sftpuser</strong> user directory:</span><p><pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen1397115212214">ls</pre>
<div class="p" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p8804185172110">If the command output does not contain the following information, no public key is added to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b19931792310">sftpuser</strong> user directory. In this case, refer to <a href="#EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li177571338172219">Adding a public key for the first time</a>. Otherwise, refer to <a href="#EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1414218493223">Adding a public key for a non-first time</a>.<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen780495142118">authorized_keys</pre>
</div>
<ul id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ul675783817228"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li177571338172219"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li177571338172219"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_li177571338172219"></a><strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b0800191102518">Adding a public key for the first time</strong><ol type="a" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ol035269111716"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li6352159171719">Run the following command to generate a public key:<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen6664413147">ssh-keygen -t rsa</pre>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li235229121713">In the SFTP CLI, run the following command to add the public key of user <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1466072365715">root</strong> on the client to the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b966072319574">sftpuser</strong> user directory:<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen1180865710477">put /root/.ssh/id_rsa.pub /sftpuser/authorized_keys</pre>
<div class="note" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_note12191174921016"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ol id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ol113521292173"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li2352199181717">After the addition, you can log in to the SFTP server as user <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b17945919192611">sftpuser</strong> under user <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b72898914292">root</strong> on the client in password-free mode. Other users still need to use passwords to log in to the server.</li></ol>
</div></div>
</li></ol>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1414218493223"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1414218493223"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1414218493223"></a><strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b5529347123018">Adding a public key for a non-first time</strong><ol type="a" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_ol189204820259"><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1692011810253"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1692011810253"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1692011810253"></a>Run the following command to temporarily store the existing public key in the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b4504162723114">sftpuser</strong> user directory to the <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol1265124212314"><b>/root/authorized_keys</b></span> file on the local server:<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen36504215236">get /sftpuser/authorized_keys /root/authorized_keys</pre>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li10572121292511">Run the following command to exit the SFTP CLI:<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen3677191853118">exit</pre>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li12507144182518">Log in as a non-<strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b1931049135711">root</strong> user and run the following command to generate a public key. After the public key is generated, switch to user <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b64501349580">root</strong>.<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen39352892613">ssh-keygen -t rsa</pre>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1152402412311"><a name="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1152402412311"></a><a name="en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1152402412311"></a>Run the following command to combine the public key of the current non-<strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b829013582414">root</strong> user on the client with the existing public key in the <strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b5268640744">sftpuser</strong> user directory: The combined public key is stored in the <span class="uicontrol" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_uicontrol15663831103419"><b>/root/authorized_keys</b></span> file on the local server.<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen1647317516327">cat /home/<em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i1043382252720">xxx</em>/.ssh/id_rsa.pub &gt;&gt; /root/authorized_keys</pre>
<div class="note" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_note1789032543016"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p168906259308"><em id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_i61917241256">xxx</em> indicates the name of a non-<strong id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_b14411830458">root</strong> user.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1474956143318">Perform <a href="#EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1692011810253">2.a</a> to enter the SFTP CLI.</li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1764077123619">Run the following command to add the combined public key in <a href="#EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li1152402412311">2.d</a>:<pre class="screen" id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_screen1931125115382">put /root/authorized_keys /sftpuser/authorized_keys</pre>
</li></ol>
</li></ul>
</p></li><li id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li159531914135518"><span>Check whether public key addition is successful.</span><p><p id="EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_p4197733165618">Perform <a href="#EN-US_TOPIC_0000001966059265__en-us_topic_0000001928243232_en-us_topic_0000001792505514_li3354184518532">1</a> again. If the SFTP CLI is directly displayed, public key addition is successful.</p>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000001965939061.html">Managing the SFTP Service (Applicable to 1.6.0 and Later Versions)</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">Copyright &copy; Huawei Technologies Co., Ltd.</div></body>
</html>